package Service;

import DAL.SqlHelper;
import Entity.Users;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class UsersService {
    public void AddUsers(){}
    public void DeleteUsers(){}
    public void UpdateUsers(){}
    public boolean QueryUsers(Users user) throws SQLException {
        //验证用户名存在性
        PreparedStatement pstmt;
        String sql = "select * from  users where username='"+user.getName()+"' and password='"+user.getPassword()+"'";
        ResultSet rs= SqlHelper.executeQuery(sql);
        if (rs.next()) {
            return true;
        }
        return false;
    }
    public void GetUsers(){}
}
